package cn.com.jit.hl.demo.pattern.singleton;

/**
 * 懒汉式单例
 *@author HL
 *@date 2020-09-10
 */
public class LazySingleton {
    private static LazySingleton instance;
    private LazySingleton(){

    }

    public static synchronized LazySingleton getInstance(){
        if(instance==null){
           instance = new LazySingleton();
        }
        return instance;
    }

}
